/**
 * @file build_config.h
 * @brief 构建配置头文件
 * @details 根据构建版本定义相关宏
 * 
 * @author zyb
 * @date 2024-09-26
 * @version 1.0.0
 */

#ifndef BUILD_CONFIG_H
#define BUILD_CONFIG_H

/* 构建版本检测 */
#ifdef BUILD_DEBUG
    #define BUILD_VERSION_DEBUG 1
    #define BUILD_VERSION_RELEASE 0
    #define BUILD_VERSION_TEST 0
    #define BUILD_VERSION_PROFILE 0
#elif defined(BUILD_RELEASE)
    #define BUILD_VERSION_DEBUG 0
    #define BUILD_VERSION_RELEASE 1
    #define BUILD_VERSION_TEST 0
    #define BUILD_VERSION_PROFILE 0
#elif defined(BUILD_TEST)
    #define BUILD_VERSION_DEBUG 0
    #define BUILD_VERSION_RELEASE 0
    #define BUILD_VERSION_TEST 1
    #define BUILD_VERSION_PROFILE 0
#elif defined(BUILD_PROFILE)
    #define BUILD_VERSION_DEBUG 0
    #define BUILD_VERSION_RELEASE 0
    #define BUILD_VERSION_TEST 0
    #define BUILD_VERSION_PROFILE 1
#else
    /* 默认使用debug版本 */
    #define BUILD_VERSION_DEBUG 1
    #define BUILD_VERSION_RELEASE 0
    #define BUILD_VERSION_TEST 0
    #define BUILD_VERSION_PROFILE 0
#endif

/* 构建信息 */
#define BUILD_VERSION_STRING "1.0.0"
#define BUILD_TIMESTAMP __DATE__ " " __TIME__

/* 日志配置 */
#if BUILD_VERSION_DEBUG
    #define LOG_LEVEL_DEFAULT 4  /* DEBUG - 全量日志（DEBUG INFO WARN ERROR） */
    #define LOG_ENABLE_CONSOLE 1
    #define LOG_ENABLE_FILE 1
    #define LOG_ENABLE_COLOR 1
    #define LOG_ENABLE_PERFORMANCE 1
    #define LOG_ENABLE_MEMORY 1
    #define LOG_ENABLE_ASSERTION 1
    #define ENABLE_PERFORMANCE_COUNTERS 1
    #define ENABLE_MEMORY_TRACKING 1
    #define ENABLE_FUNCTION_PROFILING 1
    #define ENABLE_ASSERTIONS 1
    #define ENABLE_DEBUG_PRINTS 1
    #define ENABLE_STACK_TRACE 1
    #define ENABLE_MEMORY_LEAK_DETECTION 1
#elif BUILD_VERSION_RELEASE
    #define LOG_LEVEL_DEFAULT 3  /* INFO - 显示INFO、WARN、ERROR */
    #define LOG_ENABLE_CONSOLE 1
    #define LOG_ENABLE_FILE 1
    #define LOG_ENABLE_COLOR 0
    #define LOG_ENABLE_PERFORMANCE 0
    #define LOG_ENABLE_MEMORY 0
    #define LOG_ENABLE_ASSERTION 0
    #define ENABLE_PERFORMANCE_COUNTERS 0
    #define ENABLE_MEMORY_TRACKING 0
    #define ENABLE_FUNCTION_PROFILING 0
    #define ENABLE_ASSERTIONS 0
    #define ENABLE_DEBUG_PRINTS 0
    #define ENABLE_STACK_TRACE 0
    #define ENABLE_MEMORY_LEAK_DETECTION 0
#else
    #define LOG_LEVEL_DEFAULT 4  /* INFO */
    #define LOG_ENABLE_CONSOLE 1
    #define LOG_ENABLE_FILE 1
    #define LOG_ENABLE_COLOR 1
    #define LOG_ENABLE_PERFORMANCE 1
    #define LOG_ENABLE_MEMORY 0
    #define LOG_ENABLE_ASSERTION 1
    #define ENABLE_PERFORMANCE_COUNTERS 1
    #define ENABLE_MEMORY_TRACKING 0
    #define ENABLE_FUNCTION_PROFILING 1
    #define ENABLE_ASSERTIONS 1
    #define ENABLE_DEBUG_PRINTS 1
    #define ENABLE_STACK_TRACE 1
    #define ENABLE_MEMORY_LEAK_DETECTION 0
#endif

#endif /* BUILD_CONFIG_H */
